package com.acwing.partition35;

import java.io.*;

/**
 * @author rkc
 * @date 2022/8/4 9:40
 */
public class AC3474坠落的蚂蚁 {

    private static final int N = 110;
    private static int[] p = new int[N];
    private static int n, a;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = nextInt();
        for (int i = 0; i < n; i++) {
            int pos = nextInt(), dir = nextInt();
            p[pos] = dir;
            if (dir == 0) a = pos;
        }
        int l = 0, r = 0;
        for (int i = 0; i < N; i++) {
            if (p[i] == 1 && i < a) l++;
            if (p[i] == -1 && i > a) r++;
        }
        int rank = 1 + Math.min(l, r);
        if (l < r) {
            //在A右边的第rank个
            for (int i = a + 1, j = 0; i < N; i++) {
                if (p[i] == -1) j++;
                if (j == rank) {
                    writer.println(i);
                    break;
                }
            }
        } else if (l > r) {
            //在A左边的第rank个
            for (int i = a - 1, j = 0; i >= 0; i--) {
                if (p[i] == 1) j++;
                if (j == rank) {
                    writer.println(100 - i);
                    break;
                }
            }
        } else {
            writer.println("Cannot fall!");
        }
        writer.flush();
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
